<template>
  <div>
 <el-icon @click="ck">
     <caret-left v-if="store.state.navBool"/>
     <caret-right v-else/>
 </el-icon>
</div>
</template>

<script setup lang="ts">
import { CaretRight ,CaretLeft} from "@element-plus/icons-vue";
// 引用useStore
import { useStore } from "vuex";
// 得到store对象
const store = useStore();
let ck=()=>{
 // 触发mutations修改
 console.log("点击");
 
 store.commit("SET_NAVBOOL")
}
</script>

<style scoped lang="scss">
.el-header{
 line-height: 70px;//设置图标垂直居中
 .el-icon{
     font-size:20px;//设置图标大小
 }
}
</style>